﻿#region Using's

using System;

using MyUtils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Test.MyUtils.TestHelp;

#endregion

namespace Test.MyUtils
{
	[TestClass]
	public class Test_not_null_wrapper : FixtureMsTest
	{
		void test(NotNull<string> s)
		{
			Equal("asd", s.ToString());

			Equal((string)s, s.Value);
			Equal("asd", (string)s);
			Equal("asd", s.Value);

			Equal("asd".GetHashCode(), s.Value.GetHashCode());
			True("asd" == s);
			True(object.Equals(s,"asd"));
			True(object.Equals("asd", s.Value));
			True(s.Equals("asd"));
			True(s.Equals(s));
		}

		[TestMethod]
		public void Test()
		{
			Throws<ArgumentNullException>((() => test(null)));
			NotThrows((() => test("asd")));
		}
	}
}